home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- # Move a conffile without triggering a dpkg question
- mv_conffile() {
- OLDCONFFILE="$1"
- NEWCONFFILE="$2"
-
- if [ -e "$OLDCONFFILE" ]; then
- echo "Preserving user changes to $NEWCONFFILE ..."
- mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
- mv -f "$OLDCONFFILE" "$NEWCONFFILE"
- fi
- }
-
- set -e
- case "$1" in
- configure)
- # remove bluez-sdpd init, if present
- if [ -f /etc/init.d/bluez-sdp ]; then
- /usr/sbin/update-rc.d -f bluez-sdp remove
- echo "To stop seeing this, remove the now redundant /etc/init.d/bluez-sdp script."
- fi
-
- if [ -e /etc/init.d/bluez-utils ]; then
- /usr/sbin/update-rc.d -f bluez-utils remove
- # maybe a (medium/low debconf?) notice is best suited here
- fi
-
- mv_conffile "/etc/init.d/bluez-utils" "/etc/init.d/bluetooth"
- mv_conffile "/etc/default/bluez-utils" "/etc/default/bluetooth"
-
-
- # update modules.conf
- /sbin/update-modules >/dev/null 2>&1
-
- # Remove shutdown and reboot links; this init script does not need them.
- if dpkg --compare-versions "$2" lt "3.1-1ubuntu2"; then
- rm -f /etc/rc0.d/K74bluetooth /etc/rc6.d/K74bluetooth
- fi
-
- # use MAKEDEV instead of the original bluez script below as per policy 10.6
- if [ -x /dev/MAKEDEV ]; then
- echo "Creating device nodes ..."
- cd /dev && ./MAKEDEV bluetooth
- fi
-
- # if [ -r /etc/bluetooth/pin ]; then
- # echo "Converting default outgoing PIN to default passkey:"
- # cp -v /etc/bluetooth/pin /etc/bluetooth/passkeys/default
- # fi
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 0
- ;;
- esac
-
- # Automatically added by dh_installinit
- if [ -x "/etc/init.d/bluetooth" ]; then
- update-rc.d bluetooth start 25 2 3 4 5 . stop 74 1 . >/dev/null
- if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d bluetooth start || exit $?
- else
- /etc/init.d/bluetooth start || exit $?
- fi
- fi
- # End automatically added section
-
-